<div ng-controller="ChengyunSearchCtrl as vm">
    <h1 class="page-title">搜索个人用户</h1>
    <div class="well">
        <form method='POST' action='/api/carrier/export'>
        <div class="form-horizontal">
            <fieldset>
                <div class="control-group">
                    <!-- Text input-->
                    <label class="control-label">身份证号码</label>
                    <div class="controls">
                        <input type="text" name="idCardNumber" placeholder="" class="input-xlarge" ng-model="vm.user.idCardNumber">
                        <p class="help-block"></p>
                    </div>
                </div>
                <div class="control-group">
                    <!-- Text input-->
                    <label class="control-label">联系人</label>
                    <div class="controls">
                        <input type="text" name="contactName" placeholder="" class="input-xlarge" ng-model="vm.user.contactName">
                        <p class="help-block"></p>
                    </div>
                </div>
                <div class="control-group">
                    <!-- Text input-->
                    <label class="control-label">联系人电话</label>
                    <div class="controls">
                        <input type="text" name="contactPhone" placeholder="" class="input-xlarge" ng-model="vm.user.contactPhone">
                        <p class="help-block"></p>
                    </div>
                </div>
                <div class="control-group">
                    <!-- Text input-->
                    <label class="control-label">联系人手机</label>
                    <div class="controls">
                        <input type="text" name="contactMobile" placeholder="" class="input-xlarge" ng-model="vm.user.contactMobile">
                        <p class="help-block"></p>
                    </div>
                </div>
                <div class="control-group">
                    <!-- Text input-->
                    <label class="control-label">邮箱地址</label>
                    <div class="controls">
                        <input type="text" name="email" placeholder="" class="input-xlarge" ng-model="vm.user.email">
                        <p class="help-block"></p>
                    </div>
                </div>
                <div class="control-group">
                    <!-- Text input-->
                    <label class="control-label">审核状态</label>
                    <div class="controls">
                        <select  ng-model="vm.approvalStatus">
                            <option value="0">全部</option>
                            <option value="1">未审核</option>
                            <option value="2">审核中</option>
                            <option value="3">审核通过</option>
                            <option value="4">审核未通过</option>
                        </select>
                        <p class="help-block"></p>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label"></label>
                    <!-- Button -->
                    <div class="controls">
                        <a class="btn btn-primary" ng-click="vm.searchUser()">搜索</a>
                    </div>
                </div>

            </fieldset>
        </div>
        <p ng-show="vm.noRecord">没有找到符合条件的个人用户！</p>
            <div class="table-responsive" ng-show="vm.users.length>0">
            <input name="approvalStatus" ng-value="vm.approvalStatus!=0? vm.approvalStatus:''" hidden/>
            <button class="btn" type="submit">导出结果</button>
          </form>
                <table class="table table-striped table-bordered">
                    <thead>
                    <tr>
                        <th>会员号</th>
                        <th>联系人</th>
                        <th>手机号</th>
                        <th>电子邮箱</th>
                        <th>身份证号</th>
                        <th>纳税人识别号</th>
                        <th>状态</th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="user in vm.users">
                        <td><a ng-click="vm.viewDetail(user.id)">{{user.user.memberId}}</a></td>
                        <td>{{user.contact.name}}</td>
                        <td>{{user.contact.mobile}}</td>
                        <td>{{user.contact.email}}</td>
                        <td>{{user.idCardNumber}}</td>
                        <td>{{user.taxerId}}</td>
                        <td ng-switch="user.approvalStatus">
                            <div ng-switch-when="0">未审核</div>
                            <div ng-switch-when="1">审核中</div>
                            <div ng-switch-when="2">审核通过</div>
                            <div ng-switch-when="3">审核未通过</div>
                        </td>
                        <td><a class="btn btn-primary btn-mini" ng-click="vm.viewDetail(user.id)">查看</a></td>
                    </tr>

                    </tbody>
                </table>
                    <div class="pagination pagination-centered">
        <ul>
         <li ng-class="vm.firstPage? 'disabled':''" ng-switch="vm.firstPage">
         <a ng-switch-when="false" ng-click="vm.loadPage(vm.currentPage-1)" >&laquo;</a>
         <a ng-switch-when="true" >&laquo;</a>
         </li>
          <li ng-repeat="me in vm.pages" ng-class="me==vm.currentPage? 'active':''" ng-switch="me==vm.currentPage">
            <a ng-switch-when="false" ng-click="vm.loadPage(me)" >{{me}}</a>
            <a ng-switch-when="true" >{{me}}</a>
            </li>
          <li ng-class="vm.lastPage? 'disabled':''" ng-switch on="vm.lastPage">
          <a ng-switch-when="false" ng-click="vm.loadPage(vm.currentPage+1)">&raquo;</a>
          <a ng-switch-when="true" >&raquo;</a>
          </li>
        </ul>
      </div>
            </div>
    </div>
</div>